.TH "QwtCounter" 3 "Tue Nov 20 2012" "Version 5.2.3" "Qwt User's Guide" \" -*- nroff -*-
.ad l
.nh
.SH NAME
QwtCounter \- 
.SH SYNOPSIS
.br
.PP
.PP
\fC#include <qwt_counter\&.h>\fP
.PP
Inherits \fBQwtDoubleRange\fP\&.
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBButton\fP { \fBButton1\fP, \fBButton2\fP, \fBButton3\fP, \fBButtonCnt\fP }"
.br
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBbuttonReleased\fP (double \fBvalue\fP)"
.br
.ti -1c
.RI "void \fBvalueChanged\fP (double \fBvalue\fP)"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBQwtCounter\fP (QWidget *parent=NULL)"
.br
.ti -1c
.RI "virtual \fB~QwtCounter\fP ()"
.br
.ti -1c
.RI "bool \fBeditable\fP () const "
.br
.ti -1c
.RI "int \fBincSteps\fP (\fBQwtCounter::Button\fP btn) const "
.br
.ti -1c
.RI "double \fBmaxVal\fP () const "
.br
.ti -1c
.RI "double \fBminVal\fP () const "
.br
.ti -1c
.RI "int \fBnumButtons\fP () const "
.br
.ti -1c
.RI "virtual void \fBpolish\fP ()"
.br
.ti -1c
.RI "void \fBsetEditable\fP (bool)"
.br
.ti -1c
.RI "void \fBsetIncSteps\fP (\fBQwtCounter::Button\fP btn, int nSteps)"
.br
.ti -1c
.RI "void \fBsetMaxValue\fP (double m)"
.br
.ti -1c
.RI "void \fBsetMinValue\fP (double m)"
.br
.ti -1c
.RI "void \fBsetNumButtons\fP (int n)"
.br
.ti -1c
.RI "void \fBsetStep\fP (double s)"
.br
.ti -1c
.RI "void \fBsetStepButton1\fP (int nSteps)"
.br
.ti -1c
.RI "void \fBsetStepButton2\fP (int nSteps)"
.br
.ti -1c
.RI "void \fBsetStepButton3\fP (int nSteps)"
.br
.ti -1c
.RI "virtual void \fBsetValue\fP (double)"
.br
.ti -1c
.RI "virtual QSize \fBsizeHint\fP () const "
.br
.ti -1c
.RI "double \fBstep\fP () const "
.br
.ti -1c
.RI "int \fBstepButton1\fP () const "
.br
.ti -1c
.RI "int \fBstepButton2\fP () const "
.br
.ti -1c
.RI "int \fBstepButton3\fP () const "
.br
.ti -1c
.RI "virtual double \fBvalue\fP () const "
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual bool \fBevent\fP (QEvent *)"
.br
.ti -1c
.RI "virtual void \fBkeyPressEvent\fP (QKeyEvent *)"
.br
.ti -1c
.RI "virtual void \fBrangeChange\fP ()"
.br
.ti -1c
.RI "virtual void \fBwheelEvent\fP (QWheelEvent *)"
.br
.in -1c
.SH "Detailed Description"
.PP 
The Counter Widget\&. 

A Counter consists of a label displaying a number and one ore more (up to three) push buttons on each side of the label which can be used to increment or decrement the counter's value\&.
.PP
A Counter has a range from a minimum value to a maximum value and a step size\&. The range can be specified using QwtDblRange::setRange()\&. The counter's value is an integer multiple of the step size\&. The number of steps by which a button increments or decrements the value can be specified using \fBQwtCounter::setIncSteps()\fP\&. The number of buttons can be changed with \fBQwtCounter::setNumButtons()\fP\&.
.PP
Holding the space bar down with focus on a button is the fastest method to step through the counter values\&. When the counter underflows/overflows, the focus is set to the smallest up/down button and counting is disabled\&. Counting is re-enabled on a button release event (mouse or space bar)\&.
.PP
Example: 
.PP
.nf
#include '\&.\&./include/qwt_counter\&.h>

QwtCounter *cnt;

cnt = new QwtCounter(parent, name);

cnt->setRange(0\&.0, 100\&.0, 1\&.0);             // From 0\&.0 to 100, step 1\&.0
cnt->setNumButtons(2);                      // Two buttons each side
cnt->setIncSteps(QwtCounter::Button1, 1);   // Button 1 increments 1 step
cnt->setIncSteps(QwtCounter::Button2, 20);  // Button 2 increments 20 steps

connect(cnt, SIGNAL(valueChanged(double)), my_class, SLOT(newValue(double)));

.fi
.PP
 
.SH "Member Enumeration Documentation"
.PP 
.SS "enum \fBQwtCounter::Button\fP"
Button index 
.SH "Constructor & Destructor Documentation"
.PP 
.SS "QwtCounter::QwtCounter (QWidget *parent = \fCNULL\fP)\fC [explicit]\fP"
The default number of buttons is set to 2\&. The default increments are: 
.PD 0

.IP "\(bu" 2
Button 1: 1 step 
.IP "\(bu" 2
Button 2: 10 steps 
.IP "\(bu" 2
Button 3: 100 steps
.PP
\fBParameters:\fP
.RS 4
\fIparent\fP 
.RE
.PP

.SH "Member Function Documentation"
.PP 
.SS "void QwtCounter::buttonReleased (doublevalue)\fC [signal]\fP"
This signal is emitted when a button has been released 
.PP
\fBParameters:\fP
.RS 4
\fIvalue\fP The new value 
.RE
.PP

.SS "bool QwtCounter::event (QEvent *e)\fC [protected]\fP, \fC [virtual]\fP"
Handle PolishRequest events 
.SS "int QwtCounter::incSteps (\fBQwtCounter::Button\fPbtn) const"
\fBReturns:\fP
.RS 4
the number of steps by which a specified button increments the value or 0 if the button is invalid\&. 
.RE
.PP
\fBParameters:\fP
.RS 4
\fIbtn\fP One of \fCQwtCounter::Button1\fP, \fCQwtCounter::Button2\fP, \fCQwtCounter::Button3\fP 
.RE
.PP

.SS "void QwtCounter::keyPressEvent (QKeyEvent *e)\fC [protected]\fP, \fC [virtual]\fP"
Handle key events
.PP
.IP "\(bu" 2
Ctrl + Qt::Key_Home Step to \fBminValue()\fP
.IP "\(bu" 2
Ctrl + Qt::Key_End Step to \fBmaxValue()\fP
.IP "\(bu" 2
Qt::Key_Up Increment by incSteps(QwtCounter::Button1)
.IP "\(bu" 2
Qt::Key_Down Decrement by incSteps(QwtCounter::Button1)
.IP "\(bu" 2
Qt::Key_PageUp Increment by incSteps(QwtCounter::Button2)
.IP "\(bu" 2
Qt::Key_PageDown Decrement by incSteps(QwtCounter::Button2)
.IP "\(bu" 2
Shift + Qt::Key_PageUp Increment by incSteps(QwtCounter::Button3)
.IP "\(bu" 2
Shift + Qt::Key_PageDown Decrement by incSteps(QwtCounter::Button3) 
.PP

.SS "int QwtCounter::numButtons () const"
\fBReturns:\fP
.RS 4
The number of buttons on each side of the widget\&. 
.RE
.PP

.SS "void QwtCounter::polish ()\fC [virtual]\fP"
Sets the minimum width for the buttons 
.SS "void QwtCounter::rangeChange ()\fC [protected]\fP, \fC [virtual]\fP"

.PP
Notify change of range\&. This function updates the enabled property of all buttons contained in \fBQwtCounter\fP\&. 
.PP
Reimplemented from \fBQwtDoubleRange\fP\&.
.SS "void QwtCounter::setEditable (booleditable)"

.PP
Allow/disallow the user to manually edit the value\&. \fBParameters:\fP
.RS 4
\fIeditable\fP true enables editing 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBeditable()\fP 
.RE
.PP

.SS "void QwtCounter::setIncSteps (\fBQwtCounter::Button\fPbtn, intnSteps)"
Specify the number of steps by which the value is incremented or decremented when a specified button is pushed\&.
.PP
\fBParameters:\fP
.RS 4
\fIbtn\fP One of \fCQwtCounter::Button1\fP, \fCQwtCounter::Button2\fP, \fCQwtCounter::Button3\fP 
.br
\fInSteps\fP Number of steps 
.RE
.PP

.SS "void QwtCounter::setMaxValue (doublevalue)"
Set the maximum value of the range
.PP
\fBParameters:\fP
.RS 4
\fIvalue\fP Maximum value 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetMinValue()\fP, \fBmaxVal()\fP 
.RE
.PP

.SS "void QwtCounter::setMinValue (doublevalue)"
Set the minimum value of the range
.PP
\fBParameters:\fP
.RS 4
\fIvalue\fP Minimum value 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetMaxValue()\fP, \fBminVal()\fP 
.RE
.PP

.SS "void QwtCounter::setNumButtons (intn)"

.PP
Specify the number of buttons on each side of the label\&. \fBParameters:\fP
.RS 4
\fIn\fP Number of buttons 
.RE
.PP

.SS "void QwtCounter::setStep (doublestepSize)"
Set the step size 
.PP
\fBParameters:\fP
.RS 4
\fIstepSize\fP Step size 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBQwtDoubleRange::setStep()\fP 
.RE
.PP

.PP
Reimplemented from \fBQwtDoubleRange\fP\&.
.SS "void QwtCounter::setStepButton1 (intnSteps)"
Set the number of increment steps for button 1 
.PP
\fBParameters:\fP
.RS 4
\fInSteps\fP Number of steps 
.RE
.PP

.SS "void QwtCounter::setStepButton2 (intnSteps)"
Set the number of increment steps for button 2 
.PP
\fBParameters:\fP
.RS 4
\fInSteps\fP Number of steps 
.RE
.PP

.SS "void QwtCounter::setStepButton3 (intnSteps)"
Set the number of increment steps for button 3 
.PP
\fBParameters:\fP
.RS 4
\fInSteps\fP Number of steps 
.RE
.PP

.SS "void QwtCounter::setValue (doublev)\fC [virtual]\fP"

.PP
Set a new value\&. \fBParameters:\fP
.RS 4
\fIv\fP new value Calls \fBQwtDoubleRange::setValue\fP and does all visual updates\&. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBQwtDoubleRange::setValue()\fP 
.RE
.PP

.PP
Reimplemented from \fBQwtDoubleRange\fP\&.
.SS "double QwtCounter::value () const\fC [virtual]\fP"
\fBReturns:\fP
.RS 4
Current value 
.RE
.PP

.PP
Reimplemented from \fBQwtDoubleRange\fP\&.
.SS "void QwtCounter::valueChanged (doublevalue)\fC [signal]\fP"
This signal is emitted when the counter's value has changed 
.PP
\fBParameters:\fP
.RS 4
\fIvalue\fP The new value 
.RE
.PP

.SS "void QwtCounter::wheelEvent (QWheelEvent *e)\fC [protected]\fP, \fC [virtual]\fP"
Handle wheel events 
.PP
\fBParameters:\fP
.RS 4
\fIe\fP Wheel event 
.RE
.PP


.SH "Author"
.PP 
Generated automatically by Doxygen for Qwt User's Guide from the source code\&.
